<php>
	$orderInfo 	= service('Order')->get4SysById($coupon['order_id']);
	if(!empty($orderInfo))$productdata	= service('Product')->getByShelfId($orderInfo['shelf_id']);
</php>
<php>
$_REQUEST['goPageFun']="goPageBSub";//设定分页调用函数
if(empty($bsub_brandid))$bsub_brandid	= $productdata['partner_id'];	//商户id	
$bsub_area_id	= $_REQUEST['area_id'];	//区域id	
$bsub_city_id	= $_REQUEST['city_id'];	//城市id
$bsub_bsubpage 	= service('Brand')->search4UserBSub($bsub_brandid,$bsub_area_id,$bsub_city_id,null,20);
</php>
<script type="text/javascript" charset="utf-8">
	//class="top_bar top_baron" class="top_bar"  k_changeGroupStylek_changeGroupStyle('list_top',' ul > li','detail','top_bar_on');
 	$(document).ready(function(){
 		var list_top_rel  = 'detail';
 		<php>if(empty($productdata['goods_detail'])){</php>
 			list_top_rel  = 'place';
		<php>}</php>
 		k_changeGroupStyle('list_top',' ul > li',list_top_rel,'top_bar_on');

 		initMap("map-box","39.925","116.385",11);
 		cleanAll();
 		var store_infos = eval('( ' + $('#store_json_data').html() + ' )');
 		store_markers = drawStoreMarkers(store_infos,marker_icon);
 		map.centerAndZoom( store_markers ,11 );
 	});
</script>
<div class="item_top">
	<ul>
		<li class="top_bar top-bar-wide top_baron">{:K('SP_COUPON_NM')}详情</li>
	</ul>
</div>
<!-- 券已作废，提示 -->
<php>if($coupon['is_canceled']=='Y'){</php>
<div class="blank10"></div>
<div class="k_desc_div" style="margin: 0px;text-align:left;">
	<div class="k_icon k_bulb"></div>
	<strong>{:K('SP_COUPON_NM')}[{$coupon['passcode']}]已作废！</strong>
	<div>
		作废原因：'.{$coupon['cancel_reason']}
	</div>
</div>	
<php>}</php>
<div id="payment" style="margin-top: 10px;">

							<div>
								<php>
									//数据格式：
									$tmp_mms_sample_data['send_format'] = $coupon['channel'];//发送类型 sms或mms。
									$tmp_mms_sample_data['mms_bg']=getAttachUrl(getMmsBg($productdata['shelf_id']));//发送的mms背景图片路径getAttachUrl(getMmsBg($order_data['shelf']['shelf_id']))}
									$tmp_mms_sample_data['mms_card']=getAttachUrl($coupon['namecard']);//发送的mms对应的贺卡路径U('Product://Order/getSmsImg',array('rand'=>time()))}
									
									$tmp_mms_sample_data['tplt_data']['{sender_name}'] 	= $orderInfo['sender_name'];//发送者
									$tmp_mms_sample_data['tplt_data']['{sms_message}'] 	= $coupon['message'];//短信发送的文字
									$tmp_mms_sample_data['tplt_data']['{partner_title}']	= $productdata['partner_title'];//商户名称
									$tmp_mms_sample_data['tplt_data']['{coupon_passcode}']	= $coupon['passcode'];//商品券码
									$tmp_mms_sample_data['tplt_data']['{goods_title}']		= $productdata['goods_title'];//商品名称
									$tmp_mms_sample_data['tplt_data']['{goods_quantity}']	= $coupon['quantity'];//商品数量
									$tmp_mms_sample_data['tplt_data']['{goods_expired_date}']	= paramMillisecond2Date($coupon['expired_date']);									
									$tmp_mms_sample_data['tplt_data']['{goods_ext_info}']	= getMMSExtInfo($productdata['goods_get_type'],$productdata['partner_phone'],$productdata['partner_mobile']);
									$tmp_mms_sample_data['tplt_data'] = assembleMMSData($tmp_mms_sample_data['tplt_data']);
								</php>
							 	<include file="../Public/mms_sample.html" />
			           		</div>
<!--  <div class="clear"></div> -->
					<div class="step" style="float: right; padding: 0px; width: 480px;">
				        <div class="cont" style="padding: 5px 0 0;">
							<div class="panel_style1" style="border: 0px solid #C4C2C2;">
							  	<div class="panel-title" style="background:#FFFFFF;border-bottom: 1px solid #E2E2E2;">
							         <ul class="column-tab">
							            <li class="tab-title tab-title-current" style="border-right: 0px solid #C4C2C2;color: #CC0000;">基本信息</li>
							         </ul>
							    </div>

								<div class="receiverInfo" style="margin-top: 10px;">	
									<div style="float: left;text-align: center;width:170px;height:170px;margin:10px;overflow: hidden;border: 10px solid #EBEBEB;">
										<a href="{:U('Product://Index/detailp',array('shelfid'=>$productdata['shelf_id']))}"  class="coupon_b"
							            	title="{$productdata['goods_title']}--{:getCouponStatus($coupon)}" >
								            	<em>{:getCouponStatus($coupon)}</em>
								            	<span></span>
								            	<img src="{:getPhotoFromThumb($productdata['goods_icon'],200,200)}" alt="{$productdata['goods_title']}">	
							            </a>
									</div>	
					                <table class="receiver" id="order_receivers" border="0" cellspacing="0" cellpadding="0" 
					                	style="float:left;padding-left: 10px;font-size:12px;text-align:left">
					                    <colgroup>
					                        <col width="50%"><col width="">
					                    </colgroup>
					                    <tbody>
					                    	<tr>
					                        	<td><font style="font-weight: bold;">{:K('SP_COUPON_NM')}码：</font>
						                            {$coupon['passcode']}
					                            </td>
					                            <td><font style="font-weight: bold;">商品编号：</font>
					                            	{$productdata['goods_id']}
					                            </td>
					                        </tr>
					                        <tr>
					                        	<td><font style="font-weight: bold;">送者名称：</font>
					                            	{$orderInfo['sender_name']}
					                            </td>
					                            <td><font style="font-weight: bold;">送者手机：</font>
						                            {$orderInfo['sender_mobile']}
					                            </td>
					                        </tr>
					                    	<tr>
					                        	<td><font style="font-weight: bold;">商品品牌：</font>
						                            <a href="{:U('Product://Brand/detail',array('bid'=>$productdata['partner_id']))}">{$productdata['partner_title']}</a>
					                            </td>
					                            <td><font style="font-weight: bold;">商品名称：</font>
					                            	<a href="{:U('Product://Index/detailp',array('shelfid'=>$productdata['shelf_id']))}">{$productdata['goods_title']}</a>
					                            	 &nbsp;（{$coupon['quantity']} 件）
					                            </td>
					                        </tr>
					                         <tr>
					                        	<td><font style="font-weight: bold;">发送方式：</font>
					                            	{:getChanelDesc($coupon['channel'])}
					                            </td>
					                            <td><font style="font-weight: bold;">发送时间：</font>
						                            {:paramMillisecond2Date($coupon['target_date'])} - {$coupon['target_hour']}时 发送
					                            </td>
					                        </tr>
					                        
					                        <tr>
					                            <td><font style="font-weight: bold;">使用情况：</font>
						                            <font style="color:red">{:getCouponStatus($coupon)}</font>
					                            </td>
					                            <td><font style="font-weight: bold;">有效期限：</font>
						                            {:paramMillisecond2Date($coupon['start_date'])}&nbsp;至&nbsp;{:paramMillisecond2Date($coupon['expired_date'])}
					                            </td>
					                        </tr>
					                        
					                        <tr>
					                            <td><font style="font-weight: bold;">消费时间：</font>
						                           	 {:paramMillisecond2Date($coupon['check_time'],'Y-m-d H:i','-- --')}
					                            </td>
					                            <td><font style="font-weight: bold;">消费地点：</font>
						                           	 {:getParnterTitle($coupon['checker_id'],'-- --')}
					                            </td>
					                        </tr>
					                        
					                        <tr>
					                            <td>
					                            </td>
					                            <td style="text-align:right">
					                            	<span title="重新发送{:K('SP_COUPON_NM')}！最多3次，已发送{$coupon['send_times']}！" class="cursor" style="color:#424242;font-size:14px;font-weight:bold"
								                       	onclick="resendCoupon( '{:U('User://Index/resendCoupon')}' ,{ id:'{$coupon['id']}' , oid:'{$coupon['order_id']}' ,sendRole:'receiver' } )">
								              			重发
								        			</span>
					                            </td>
					                        </tr>
					                       
					                    </tbody>
					                </table>
					                <div class="clear"></div>
				            	</div>  
				           	</div>
				         </div>
					  </div>
			
</div>
<div class="blank10"></div><div class="blank10"></div>
<div class="item_top">
	<ul>
		<li class="top_bar top-bar-wide top_baron" style="width: 230px;">兑换地点（北京 共{$bsub_bsubpage["count"]}家分店）</li>
	</ul>
</div>
<div class="blank10"></div>
<div id="store_json_data" class="hidden">
		<php>
		if(count($bsub_bsubpage['data'])>0){
			echo json_encode( format2MapData($bsub_bsubpage['data']) );
		}
		</php>
	</div>
<div id="map-box">
</div>
<div class="blank10"></div><div class="blank10"></div><div class="blank10"></div>
